
#include <ukui-log4qt.h>
#include <QApplication>
#include <QStandardPaths>
#include <QFile>
#include <fcntl.h>
#include <syslog.h>
#include "protocolmanager.h"

int main(int argc, char *argv[])
{
//    initUkuiLog4qt("sni-daemon");
    /*单例+vnc模式*/
    QStringList homePath = QStandardPaths::standardLocations(QStandardPaths::HomeLocation);
    int fd = open(QString(homePath.at(0) + "/.config/systemtraydaemon.lock").toUtf8().data(), O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
    if (fd < 0) { exit(1); }
    if (lockf(fd, F_TLOCK, 0)) {
        syslog(LOG_ERR, "Can't lock single file, systemtraydaemon is already running!");
        exit(0);
    }
    QApplication a(argc, argv);
    qDebug()<<">>>>> protocolManager";
    ProtocolManager protocolManager;




    return a.exec();
}
